#pragma once
#include "Singleton.h"
#include <box2d\Box2D.h>


class GameSceneContactListener: public b2ContactListener
{
public:
	void PreSolve(b2Contact* contact, const b2Manifold* oldManifold);
};


class Ground;
class Robot;
class GameScene :public Singleton<GameScene>
{
	friend Singleton;
private:
	// constructor.
	GameScene();

	// destructor.
	~GameScene();

public:
	void Initialize();

	bool ParseRobot(const char* xml, uint length);

	void GameStart();

	void GameEnd();

	// update
	void OnUpdate(float frameTime);

	// render
	void OnPreRender();

	void CreateRobotPart();

	GameSceneContactListener* GetContactListener();

private:
	std::shared_ptr<Ground>		m_Ground;

	std::shared_ptr<Robot>		m_Robot1P;
	std::shared_ptr<Robot>		m_Robot2P;

	GameSceneContactListener	m_ContactListener;
};